home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amoszine 9
/
Amoszine 9 (Disk 3 of 3).adf
/
Mikes_TMH_Source.lha
/
ASL.Amos
/
ASL.amosSourceCode
Wrap
AMOS Source Code
|
1995-08-28
|
5KB
|
150 lines
'
' ****************************
' * ASL File Requester *
' * From AMOS without any *
' * expensive Extensions *
' ****************************
'
'
' By Mike Richmond, based on a routine by John.A.Kinsella
'
' Needs : `ASL.Library' in LIBS: and `Requestfile' in C:
' `Requestfile' is a C command supplied with AmigaDOS v2.1 and above,
' copy it from Workbench3.O:C to Amos's C drawer if noy running from
' hard disk. Send me an A12OO + hard disk if you like this proc.
'
' Only kidding, but you can if you like!
'
' You have to check yourself if cancel was pressed (Length of temp file=0)
'
'
' Version 1.00
'
' This procedure supports all of Requestfile's parameters, which are explained
' below for non CLI-o'philes.
'
Screen Open 0,640,200,2,Hires : Curs Off : Flash Off : Cls 0
'
'
' Examples:
'
' 1: Basic file requester
'
Amos To Back
_FILEREQ["SYS:","","#?","Choose a file","","","","",0,0,0]
FILE$=Param$
Amos To Front
_SHOWFILE[FILE$]
'
'
' 2: Ignore icon files
'
Amos To Back
_FILEREQ["","","","No Icons Shown!","Choose","Get Lost","","",0,0,True]
FILE$=Param$
Amos To Front
_SHOWFILE[FILE$]
'
'
' 3: Just drawers
'
Amos To Back
_FILEREQ["","","","Choose a drawer","FISH","CHIPS","","",0,True,0]
FILE$=Param$
Amos To Front
_SHOWFILE[FILE$]
'
'
'
' ****************************************************************************
'
'
Procedure _FILEREQ[_DRAWER$,_FILE$,_PATTERN$,_TITLE$,_YES$,_NO$,_ACCPAT$,_REJPAT$,_MULTISELECT,_DRAWERSONLY,_NOICONS]
'
' Procedure : ASL File Requester v1.OO
' Author : Mike Richmond
' Comments : Don't forget to send AMOS to the back before using this
' procedure, and to return it to the front when finished.
'
' Requires LIBS:ASL.Library and C:Requestfile
'
' You will have to write your own routine to separate files
' from drawers, and multi files etc.
'
' This is what it all menas...
'
' _DRAWER$ is the drawer to initially display (i.e. the current drawer)
'
' _FILE$ is the file already in the button (to re-load the same file, for example)
'
' _PATTERN$ is the search pattern, in standard AMIGADOS format
' (e.g. #?,MOD.#?,??O?,#?|~(#?.info)
' use the | character to separate each part
' [BUY CLINDEX v2 FROM F1 L/W FOR MORE INFO ON PATTERN MATCHING]
'
' _TITLE$ is the title of the file reqester
'
' _YES$ is the text to be displayed on the 'Okay' button
'
' _NO$ is the text to be displayed on the 'Cancel' button
'
' _ACCPAT$ is the pattern(s) which will be displayed by the requester, so
' if the user enters the file as, say "MOD.#?", only MOD.xxx
' files will be displayed.
'
' _REJPAT$ is the pattern(s) that aren't allowed
'
' _MULTISELECT : If this is set to True (-1) then the user can select
' several files by holding Shift and clicking on them
'
' _DRAWERSONLY : If this is set to True (-1), only drawers are displayed
' (e.g. for selecting the default drawer to load files from)
'
' _NOICONS : If this is True (-1), all .info files are hidden. It is the
' same as putting _REJPAT$ as "#?.info"
'
'
' First, the command line is built up, depending on which options have
' been selected.
'
' CHR$(34) is the ASCII code for the " character
'
A$="C:REQUESTFILE >RAM:AMOS-FILE"
If _DRAWER$<>"" : A$=A$+" DRAWER="+Chr$(34)+_DRAWER$+Chr$(34) : End If
If _FILE$<>"" : A$=A$+" FILE="+Chr$(34)+_FILE$+Chr$(34) : End If
If _PATTERN$<>"" : A$=A$+" PATTERN="+Chr$(34)+_PATTERN$+Chr$(34) : End If
If _TITLE$<>"" : A$=A$+" TITLE="+Chr$(34)+_TITLE$+Chr$(34) : End If
If _YES$<>"" : A$=A$+" POSITIVE="+Chr$(34)+_YES$+Chr$(34) : End If
If _NO$<>"" : A$=A$+" NEGATIVE="+Chr$(34)+_NO$+Chr$(34) : End If
If _ACCPAT$<>"" : A$=A$+" ACCEPTPATTERN="+Chr$(34)+_ACCPAT$+Chr$(34) : End If
If _REJPAT$<>"" : A$=A$+" REJECTPATTERN="+Chr$(34)+_REJPAT$+Chr$(34) : End If
If _MULTISELECT=True : A$=A$+" MULTISELECT" : End If
If _DRAWERSONLY=True : A$=A$+" DRAWERSONLY" : End If
If _NOICONS=True : A$=A$+" NOICONS" : End If
'
Exec A$
'
' If a file was selected, copy it into FILE$, otherwise load FILE$ with
' a blank string.
'
If Exist("RAM:AMOS-FILE")
Open In 1,"RAM:AMOS-File"
FILE$=Input$(1,Lof(1))
Close 1
Else
FILE$=""
End If
'
Kill "RAM:Amos-file"
'
I=Instr(FILE$,Chr$(34),2)
FIL$=Mid$(FILE$,2,I-2)
'
End Proc[FIL$]
'
Procedure _SHOWFILE[FILE$]
Print FILE$
Print "Left mouse to continue..."
Print
Repeat : Multi Wait : Until Mouse Key<>0
End Proc